# ------  collection --------

// create
db.createCollection("foo")
DB -> createCollection("foo");

// creates a collection named log with a maximum size of 5 megabytes and a maximum of 5000 documents.
db.createCollection("log", { capped : true, size : 5242880, max : 5000 } )
DB -> createCollection(String name, DBObject options)

// pre-allocates a 2-gigabyte, uncapped collection named people:
db.createCollection("people", { size: 2147483648 } )

// Read

// get collection
db.getCollection(name)
DB -> getCollection(String name)

// list all collections
show collections
DB -> getCollectionNames()

// delete
db.foo.drop()
DBCollection -> drop()

// remove all documents from the collection foo
db.foo.remove()

// removes all documents that match this criteria
db.foo.remove({"opt-out" : true})

db.foo.stats()
processing sequence : sort -> skip -> limit 